<?php 
/**
 * 
 * 个人设置 处理类
 * @author tanzhe
 *
 */
class home {
	public function get() { //获得已有衣服
		$url = new Url();
	  	$key = $url->get('key');
		$homeModel = new HomeModel(); 
		$ret = $homeModel->getClothes($key);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}
	
	public function save() { //换装
		$url = new Url();
		$key = $url->get('key');
	  	$clothes = $url->get('clothes');
	  	$clothes  = json_encode(array(
	  		1=>'',2=>'',3=>'lianyi_2',4=>'lianyi_3',5=>'',6=>'',7=>'lianyi_4',
	  	));
		$homeModel = new HomeModel();
		$ret = $homeModel->saveClothes($key, $clothes);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}	
	
}
?>